#pragma once

#include <stdarg.h>
#include <stdint.h>
#include <stdbool.h>

#include <time.h>
#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <direct.h>
#include <memory.h>
#include <stdarg.h>
#include <string.h>
#include <process.h>
#include <Winsock2.h>
#include <assert.h>
#include <TCHAR.h>
#include <windows.h>

#include "ghttp.h"
#include "pthread.h"
#include "semaphore.h"
#include "mqtt_c.h"

#include "zq_device.h"
//#include "zq_helper.h"


#define application_init(a, b, c, d)
#define QL_UART_PORT_1		0       // only for E800G platform
#define QL_MAIN_UART_PORT   0       // only for E800K platform, 板子上是2，映射到0
#define QL_BT_UART_PORT     1       // only for E800K platform, 映射到1
#define UART_1				0		// only for HS2131 platform, 板子上是1，映射到0

typedef pthread_mutex_t ZqMutexHandle;
typedef sem_t ZqSempHandle;
typedef pthread_t ZqThreadHandle;
typedef UINT_PTR ZqTimerHandle;

typedef enum
{
    FOTA_CLEAR = 0,
    FOTA_IMAGE_IS_PARTIAL,
    FOTA_IMAGE_IS_READY,
    FOTA_UPDATE_SUCCESS,
    FOTA_UPDATE_FAILED,
} FOTA_FLAG_E;


typedef enum _wakelockmodes {
    LOCK_SLEEP = 0,
    LOCK_SUSPEND,
    LOCK_NONE,
    LOCK_MAX = 0x7FFFFFFF
} WAKE_LOCK_MODES;

extern int KING_WakeLock(WAKE_LOCK_MODES LockMode, const uint8_t* LockName);


